﻿Imports System.Net.Mail
Imports NENAData.NENAMember

Partial Public Class Email
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Try

            Dim oMessage As MailMessage = New MailMessage()
            oMessage.From = New MailAddress("gary@nena.ca")
            oMessage.To.Add(New MailAddress("gary.pronych@gmail.com"))

            oMessage.Subject = "test email from RAR"
            oMessage.Body = "this is an email"
            oMessage.IsBodyHtml = True

            Dim client As SmtpClient = New SmtpClient("rarsk.com", 25)
            client.Credentials = New System.Net.NetworkCredential("gpronych", "garyrhd")
            client.Send(oMessage)
        Catch ex As Exception
            Response.Write("failure")
        End Try
        Response.Write("success")

    End Sub

End Class